
import java.awt.*;
import java.util.*;

public class ComponentCollection {
	
	ArrayList<GameComponent> components;
	//ArrayList<Dispatcher<?>> dispatchers;
	public ComponentCollection()
	{
		components = new ArrayList<GameComponent>();
		//dispatchers = new ArrayList<Dispatcher<?>>();
	}
	
	public void addComponent(GameComponent comp)
	{
		components.add(comp);
	}
	
	public void render(Graphics2D g)
	{
		for(GameComponent component : components)
			component.render(g);
	}
	
	public void update(float dt)
	{
		for(GameComponent component : components)
			component.update(dt);
	}
	
	public interface GameComponent
	{
		public void initialise(ComponentCollection colection);
		public void update(float dt);
		public void render(Graphics2D g);
	}

}


